export function debounce(delay: number, callback: Function): Function {
  let lastTime: NodeJS.Timeout;
  return function (this: any) {
    clearTimeout(lastTime);
    const that = this;
    const args = arguments;
    lastTime = setTimeout(() => {
      callback.apply(that, args);
    }, delay);
  };
}
